<?php
/**
 * common.php               common.php
 *
 * @author                  mashanling(msl-138@163.com)
 * @date                    2012-03-23 15:54:10
 * @last modify             2012-09-18 10:06:19 by mashanling
 */

!defined('ROOT') && exit('Access Denied');

ob_get_level() != 0 && ob_end_clean();
ob_start('ob_gzhandler');//压缩输出 by mashanling on 2012-09-12 14:29:11

header('content-type:text/html; charset=utf-8');

define('_PHP_FILE_'         , $_SERVER['SCRIPT_NAME']);//当前执行文件名，如/admin.php
define('__ROOT__'           , '');
define('ROOT_PATH_UP'       , dirname(ROOT) . '/');//网站根目录上层
define('INCLUDE_PATH'       , ROOT_PATH_UP . 'include/'); //include包含路径
define('APP_PATH'           , ROOT_PATH_UP . 'App/' . APP_NAME . '/');//项目目录
define('SESSION_PATH'       , ROOT_PATH_UP . 'sessions/');//session保存目录by mashanling on 2012-09-18 10:04:33

require(INCLUDE_PATH . 'app_config.php');

if (IS_LOCAL && APP_DEBUG) {//本地开发环境by mashanling on 2012-09-12 14:08:24
    error_reporting(E_ALL|E_STRICT);//错误报告
    ini_set('display_errors', 1);//显示错误
}
else {
    ini_set('display_errors', 0);
}

require(INCLUDE_PATH . 'db_config.php');
require('ThinkPHP/ThinkPHP.php');